﻿using System;
using System.Diagnostics.Contracts;

namespace OpenWaves.ActivityFeed.NHibernate
{
    public class NHibernateInlineSessionFactoryConfiguration: INHibernateSessionFactoryConfiguration
    {
        private readonly string _connectionString;

        public NHibernateInlineSessionFactoryConfiguration(string connectionString)
        {
            Contract.Requires<ArgumentNullException>(String.IsNullOrEmpty(connectionString) == false);
            this._connectionString = connectionString;
        }

        public static INHibernateSessionFactoryConfiguration ParseConnectionString(string connectionString)
        {
            return new NHibernateInlineSessionFactoryConfiguration(connectionString);
        }

        public string ConnectionString
        {
            get { return this._connectionString; }
        }
    }
}